// @algorithm @lc id=1000344 lang=cpp
// @title uUsW3B

#include "algm/algm.h"
#include <iostream>
#include <string>
#include <vector>
using namespace std;
class Solution {
public:
    vector<vector<int>> ans;
    vector<int> temp;
    vector<vector<int>> combine(int n, int k) {
        backtracking(1, n, k);
        return ans;
    }
    void backtracking(int cur, int n, int k) {
        if (k == 0) {
            ans.push_back(temp);
            return;
        }
        if (cur > n) {
            return;
        }
        temp.push_back(cur);
        backtracking(cur + 1, n, k - 1);
        temp.pop_back();
        backtracking(cur + 1, n, k);
        return;
    }
};